xen: sched: reassign vCPUs to pCPUs, when they come back online
authorDario Faggioli <dfaggioli@suse.com>
Mon, 5 Aug 2019 10:50:56 +0000 (11:50 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 5 Aug 2019 10:50:56 +0000 (11:50 +0100)
commitfaa2c904fbc05cb740d6d9369cd6c32258736b0e
tree4877b31cbf32854b6ddc9cf7b814a60ce224dd77
parentd545f1d6c2519a183ed631cfca7aff0baf29fde5
xen: sched: reassign vCPUs to pCPUs, when they come back online

When a vcpu that was offline, comes back online, we do want it to either
be assigned to a pCPU, or go into the wait list.

Detecting that a vcpu is coming back online is a bit tricky. Basically,
if the vcpu is waking up, and is neither assigned to a pCPU, nor in the
wait list, it must be coming back from offline.

When this happens, we put it in the waitqueue, and we "tickle" an idle
pCPU (if any), to go pick it up.

Looking at the patch, it seems that the vcpu wakeup code is getting
complex, and hence that it could potentially introduce latencies.
However, all this new logic is triggered only by the case of a vcpu
coming online, so, basically, the overhead during normal operations is
just an additional 'if()'.

Signed-off-by: Dario Faggioli <dario.faggioli@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Message-Id: <156412236222.2385.236340632846050170.stgit@Palanthas>
xen/common/sched_null.c